<!-- 回滚学生课程 -->
<template>
  <div>
    <el-form label-width="80px" :inline="true">
      <el-form-item label="手机号">
        <el-input
          v-model="search.mobile"
          placeholder="请输入需要改变的手机号"
          clearable
        ></el-input>
      </el-form-item>
      <!-- <el-form-item label="商品id">
        <el-input v-model="search.goodsid" placeholder="请输入商品id" clearable></el-input>
      </el-form-item>-->
      <el-form-item label="订单id">
        <el-input
          v-model="search.orderId"
          placeholder="请输入订单id"
          clearable
        ></el-input>
      </el-form-item>
      <el-form-item>
        <el-button
          :type="search.restrict ? 'danger' : 'primary'"
          @click="updataFn"
          size="small"
          >{{ !search.restrict ? '提交' : '不效验期次提交' }}</el-button
        >
      </el-form-item>
      <el-form-item>
        <el-button
          icon="el-icon-setting"
          circle
          @click="restrictShow = !restrictShow"
        ></el-button>
      </el-form-item>
      <el-form-item v-if="restrictShow">
        <el-button
          type="primary"
          @click="
            search.restrict = false
            restrictShow = false
          "
          size="small"
          >提交</el-button
        >
        <el-button
          type="danger"
          @click="
            search.restrict = true
            restrictShow = false
          "
          size="small"
          >不效验期次提交</el-button
        >
      </el-form-item>
    </el-form>
    <!-- <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>批量报名的手机号码(支持，隔开批量新增)</span>
        <el-button style="float: right; padding: 3px 0" type="text">手机号个数：{{phoneArr.length}}个</el-button>
      </div>

      <el-tag
        v-for="(tag,i) in phoneArr"
        :disable-transitions="true"
        @close="delPhone(i)"
        :key="i"
        closable
        style="margin-right:10px;margin-bottom:20px"
      >{{tag}}</el-tag>
    </el-card>-->
  </div>
</template>

<script>
import { rollbackStudentCourse } from '@/api/tools.js'
export default {
  data () {
    return {
      search: {
        mobile: '',
        orderId: '',
        restrict: false
      },
      restrictShow: false,
      phoneArr: []
    }
  },
  created () {},
  mounted () {},
  methods: {
    // 点击增加课程的id
    updataFn () {
      let { mobile, orderId, restrict } = this.search
      let param = {
        orderId,
        mobile,
        restrict
      }
      rollbackStudentCourse(param).then(res => {
        this.search = {
          mobile: '',
          orderId: '',
          restrict
        }
        this.$message({
          message: res[1].msg,
          type: 'success'
        })
      })
    }
  }
}
</script>
<style scoped>
/* @import url(); 引入css类 */
</style>
